package com.haixiaoke.saas.order.service;

import com.haixiaoke.saas.order.domain.OrderHousingExpenses;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.util.Date;
import java.util.List;

/**
 * 订单每日房费详情Service接口
 * 
 * @author panda
 * @date 2024-04-03
 */
public interface IOrderHousingExpensesService {
    /**
     * 查询订单每日房费详情
     * 
     * @param id 订单每日房费详情主键
     * @return 订单每日房费详情
     */
    OrderHousingExpenses selectOrderHousingExpensesById(Long id);

    /**
     * 查询订单每日房费详情列表
     * 
     * @param orderHousingExpenses 订单每日房费详情
     * @return 订单每日房费详情集合
     */
    List<OrderHousingExpenses> selectOrderHousingExpensesList(OrderHousingExpenses orderHousingExpenses);

    /**
     * 新增订单每日房费详情
     * 
     * @param orderHousingExpenses 订单每日房费详情
     * @return 结果
     */
    int insertOrderHousingExpenses(OrderHousingExpenses orderHousingExpenses);

    /**
     * 修改订单每日房费详情
     * 
     * @param orderHousingExpenses 订单每日房费详情
     * @return 结果
     */
    int updateOrderHousingExpenses(OrderHousingExpenses orderHousingExpenses);

    /**
     * 批量删除订单每日房费详情
     * 
     * @param ids 需要删除的订单每日房费详情主键集合
     * @return 结果
     */
     int deleteOrderHousingExpensesByIds(Long[] ids);

    /**
     * 删除订单每日房费详情信息
     * 
     * @param id 订单每日房费详情主键
     * @return 结果
     */
     int deleteOrderHousingExpensesById(Long id);

    /**
     * 查询该房屋下指定时间范围的租房时间
     * @param houseId
     * @param startTime
     * @param endTime
     * @return
     */
    List<LocalDate> selectRentingTimeByHouseIdAndTime(String houseId, Date startTime, Date endTime);

    /**
     * 批量插入订单每日房费详情
     * @param orderHousingExpensesList
     * @return
     */
    int insertBatchOrderHousingExpenses(List<OrderHousingExpenses> orderHousingExpensesList);

    /**
     * 查询这个订单下的房费收费详情
     * @param orderId
     * @return
     */
    List<OrderHousingExpenses> selectHousingExpensesByOrderId(String orderId, boolean afterFlag);

    /**
     * 查询这个订单今天的房费
     * @param orderId
     * @return
     */
    OrderHousingExpenses selectOrderHousingExpensesByDate(String orderId, LocalDate nowDate);

    List<OrderHousingExpenses> selectHousingExpensesByOrderIdOrLinkedOrderId(String orderId, boolean afterFlag);

    int updateExpensesByOrderIdAndLinkedOrderId(String orderId, String houseId);
}
